<?php

namespace app\mall\ui\form;

use app\mall\enum\InvoiceStatusEnum;

/**
 * 发票管理表单
 */
class MallInvoiceForm
{
    public function uid()
    {
        return [
            'type' => 'number',
            'title' => '会员',
            'field' => 'uid',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function money()
    {
        return [
            'type' => 'number',
            'title' => '开票金额',
            'field' => 'money',
            'props' => [
                'precision' => 2,
            ],
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function title()
    {
        return [
            'type' => 'input',
            'title' => '发票抬头',
            'field' => 'title',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function sn()
    {
        return [
            'type' => 'input',
            'title' => '社会信用代码',
            'field' => 'sn',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function linkman()
    {
        return [
            'type' => 'input',
            'title' => '联系人姓名',
            'field' => 'linkman',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function address()
    {
        return [
            'type' => 'input',
            'title' => '地址',
            'field' => 'address',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function phone()
    {
        return [
            'type' => 'input',
            'title' => '联系人电话',
            'field' => 'phone',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function desc()
    {
        return [
            'type' => 'input',
            'title' => '开票备注',
            'field' => 'desc',
        ];
    }

    public function zip()
    {
        return [
            'type' => 'input',
            'title' => '邮编',
            'field' => 'zip',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function status()
    {
        return [
            'type' => 'radio',
            'options' => InvoiceStatusEnum::toZhArrayForSelect(),
            'title' => '状态',
            'field' => 'status',
        ];
    }
    public function courier_number()
    {
        return [
            'type' => 'text',
            'title' => '快递单号',
            'field' => 'courier_number',
        ];
    }
    public function courier_time()
    {
        return [
            'type' => 'datetime',
            'title' => '快递日期',
            'field' => 'courier_time',
        ];
    }
}